#include "StartButton.h"
#include "Graphics/SpriteAnimationManager.h"

StartButton::StartButton()
	: Object(),
	m_Scale(1.0f),
	m_ScaleValue(0.1f),
	m_SpriteSheetComp(nullptr)
{
}

StartButton::~StartButton()
{
}

void StartButton::Initialize()
{
	star::SpriteAnimationManager::GetInstance()->AddSpritesheet(_T("Menu/StartButton.xml"), _T("Menu/StartButton.star"));
	m_SpriteSheetComp = new star::SpritesheetComponent(_T("Menu/StartButton.png"), _T("StartButton"), _T("StartButton"));
	
	AddComponent(m_SpriteSheetComp);
}

void StartButton::Update(const star::Context& context )
{
	if(m_SpriteSheetComp->GetCurrentAnimation() != _T("fun"))
	{
		m_SpriteSheetComp->PlayAnimation(_T("fun"));
	}
}

